package com.itetchologyandenglish.home.controller.Api;

import com.itetchologyandenglish.home.config.Log;
import com.itetchologyandenglish.home.enetity.Logistics;
import com.itetchologyandenglish.home.enetity.Result;
import com.itetchologyandenglish.home.service.LogisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@Api(tags={"国际物流模块"})
@RestController
@RequestMapping("/mflow")
public class LogisticsApiController {
    @Resource
    LogisticsService logisticsService;
    @ApiOperation("更新物流信息")
    @Log("国际物流管理-更新物流信息")
    @RequestMapping("/updateflow")
    public Result updateflow(Logistics logistics){
        if(logisticsService.updateflow(logistics)){
            return new Result(200,"success");
        }else{
            return new Result(200,"error");
        }
    }
    @ApiOperation("查看物流信息")
    @Log("国际物流管理-根据ID查找物流信息")
    @RequestMapping("/mflowByModuleId")
    public Result<Logistics> mflowByModuleId(Integer id){
        logisticsService.mflowByModuleId(id).toString();
        return new Result<Logistics>(200,"success",logisticsService.mflowByModuleId(id));
    }

}
